#pragma once
#include "ParseTree.h"
#include <fstream>
#include <iostream>

class CodeMaker
{
    static std::ofstream code;
    static int labelCounter;

public:
    CodeMaker();
    ~CodeMaker();

    static void setOutput();
    static int getLabelingNr();

    static void makeCode();
    static void makePROG(ParseTree* tree);
    static void makeDECLS(ParseTree* tree);
    static void makeDECLSe(ParseTree* tree);
    static void makeDECL(ParseTree* tree);
    static void makeARRAY(ParseTree* tree);
    static void makeARRAYe(ParseTree* tree);
    static void makeSTATEMENTS(ParseTree* tree);
    static void makeSTATEMENTSe(ParseTree* tree);
    static void makeSTATEMENT_ASSIGN(ParseTree* tree);
    static void makeSTATEMENT_PRINT(ParseTree* tree);
    static void makeSTATEMENT_READ(ParseTree* tree);
    static void makeSTATEMENT_CURLY_BR_OPEN(ParseTree* tree);
    static void makeSTATEMENT_IF(ParseTree* tree);
    static void makeSTATEMENT_WHILE(ParseTree* tree);
    static void makeEXP(ParseTree* tree);
    static void makeEXP2_BR_OPEN(ParseTree* tree);
    static void makeEXP2_IDENTIFIER(ParseTree* tree);
    static void makeEXP2_INTEGER(ParseTree* tree);
    static void makeEXP2_MINUS(ParseTree* tree);
    static void makeEXP2_EXCL(ParseTree* tree);
    static void makeINDEX(ParseTree* tree);
    static void makeINDEXe(ParseTree* tree);
    static void makeOP_EXP(ParseTree* tree);
    static void makeOP_EXPe(ParseTree* tree);
    static void makeOP_PLUS   (ParseTree* tree);
    static void makeOP_MINUS  (ParseTree* tree);
    static void makeOP_MULT   (ParseTree* tree);
    static void makeOP_DIV    (ParseTree* tree);
    static void makeOP_LESS   (ParseTree* tree);
    static void makeOP_GREATER(ParseTree* tree);
    static void makeOP_EQUAL  (ParseTree* tree);
    static void makeOP_UNEQUAL(ParseTree* tree);
    static void makeOP_AND    (ParseTree* tree);

};
